export default {
  namespaced: true,
  state: {
    status: false,
    content: "滴滴",
    // success 成功, info 警告, danger 失败
    type: "success",
  },
  mutations: {
    changeStatus(state, { show, content, type } = {}) {
      state.status = show;
      state.content = content;
      state.type = type;
    },
  },
  actions: {
    asyncChangeStatus(context, { content, type } = {}) {
      context.commit("changeStatus", {
        show: true,
        content,
        type,
      });
      setTimeout(() => {
        context.commit("changeStatus", {
          show: false,
          content,
          type,
        });
      }, 2000);
    },
  },
};
